function save_address() {
	var name = $("#name").val();
	var phoneNo = $("#phoneNo").val();
	var addressDes = $("#addressDes").val();

	var postcode = $("#postcode").val();

	var crarsDefault = $('#select_right').hasClass("select_right")?1:2;

	if(name.length==0){
		alert("收货人不能为空");
		return;
	}
	if(phoneNo.length==0){
		alert("请填入手机号");
		return;
	}
	if(addressDes.length==0){
		alert("请填入收货地址");
		return;
	}

	var ssq = $("#ssq").val();
	if(ssq.length==0){
		alert("省市区不能为空");
		return;
	}

	var userUuid = dataGet("userUuid");
	var data= "&crarsUser=" + userUuid + "&crarsName=" + name + "&crarsTel=" + phoneNo + "&crarsCity=" + ssq + "&crarsAddress=" + addressDes + "&crarsDefault="+crarsDefault;
    var url = urlfile + "coreAddress/add/address";
    ajaxTool("post",data,url,
        function error(XMLHttpRequest, textStatus, errorThrown,fnErr){
            alert("error:" + XMLHttpRequest);
        },
        function success(data){
        	JdataSave('myAddress',data.data);
            if(!data.success) {
                alert(data.errMsg);
            }else{
            	backPage();
            }
        }
    );
}

function address_check() {
	var select_right = $('#select_right');
	if(select_right.hasClass("select_right")) {
		select_right.removeClass('select_right');
		select_right.addClass('noSelect_right');
	}else {
		select_right.removeClass('noSelect_right');
		select_right.addClass('select_right');
	} 
}
